package arrays;

import java.util.Random;

public class UtilArray {
    
	private static UtilArray instance = null;
	
	public static synchronized UtilArray getInstance() {
		 if(instance==null) {
			 instance = new UtilArray();
		 }
		return instance;
	}
	
	public static Integer[] makeSortedArray(int t) {
		Integer[] a1 = new Integer[t];
		for (int i = 0; i != t; i++) {
			a1[i] = i;
		}
		return a1;
	}

	public static Integer[] makeRandomArray(int t) {
		Integer[] a1 = new Integer[t];

		for (int i = 0; i != a1.length; i++) {
			a1[i] = new Random().nextInt(t);
		}
		return a1;
	}

	public static int[] makePrimitiveArray(int t) {
		int[] a1 = new int[t];

		for (int i = 0; i != a1.length; i++) {
			a1[i] = new Random().nextInt(t);
		}
		return a1;
	}

	public static void printArr(Object... arr) {
		for (Object o : arr) {
			System.out.print(o + ",");
		}
		System.out.println();
	}
}
